package com.bw.zg3park2212.order

import androidx.lifecycle.MutableLiveData
import com.bw.base.entity.OrderAddParam
import com.bw.base.entity.OrderEntity
import com.bw.base.entity.OrderEntityItem
import com.bw.base.mvvm.BaseViewModel
import com.bw.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class OrderViewModel @Inject constructor(val apiService: ApiService): BaseViewModel(){
    var orderSucsse=MutableLiveData<OrderEntity>()
    fun getorder(){
        httpRequst(
            {apiService.getorder()},
            orderSucsse::postValue)
    }
    var orderstatusSuccse=MutableLiveData<OrderEntity>()
    fun getorderstatus(status:String){
        httpRequst(
            {apiService.getorderstatus(status)},
            orderstatusSuccse::postValue)
    }
    var ordernameSuccse=MutableLiveData<OrderEntity>()
    fun getordername(inspector:String,status:String){
        httpRequst(
            {apiService.getordername(inspector,status)},
            ordernameSuccse::postValue)
    }
    var orderdelSuccse=MutableLiveData<Boolean>()
    fun getorderdel(id:Int){
        httpRequst(
            {apiService.getorderdel(id)},
            orderdelSuccse::postValue)
    }
    var orderxingSuccse=MutableLiveData<OrderEntityItem>()
    fun getorderxing(id:Int){
        httpRequst(
            {apiService.getorderxiang(id)},
            orderxingSuccse::postValue)
    }
    var orderstartSuccse=MutableLiveData<OrderEntityItem>()
    fun getorderstart(id:Int){
        httpRequst(
            {apiService.getorderstart(id)},
            orderstartSuccse::postValue)
    }
    var orderendSuccse=MutableLiveData<OrderEntityItem>()
    fun getorderend(id:Int){
        httpRequst(
            {apiService.getorderend(id)},
            orderendSuccse::postValue)
    }
    var orderupSuccse=MutableLiveData<OrderEntityItem>()
    fun getorderup(id :Int,orderAddParam: OrderAddParam){
        httpRequst(
            {apiService.getorderup(id,orderAddParam)},
            orderupSuccse::postValue
        )
    }
    var orderaddSuccse=MutableLiveData<OrderEntityItem>()
    fun getorderadd(orderAddParam: OrderAddParam){
        httpRequst(
            {apiService.getorderadd(orderAddParam)},
            orderaddSuccse::postValue
        )
    }
}